package cn.shadow.game.chess;

import cn.shadow.bean.PlayerModule;
import io.netty.buffer.ByteBuf;

public class ChessPlayer implements Observer {
    private PlayerModule playerModule;
    private boolean isBlack;
    private String gameId = "";
    public ChessPlayer(PlayerModule playerModule, boolean isBlack) {
        this.playerModule = playerModule;
        this.isBlack = isBlack;
    }

    public void sendMessage(ByteBuf myMessage) {
        playerModule.sendMessage(myMessage);
    }

    public Long getId() {
        return playerModule.getId();
    }

    public String getGameId() {
        return gameId;
    }

    public void setGameId(String gameId) {
        this.gameId = gameId;
    }

    @Override
    public void sendViewMsg(ByteBuf message) {
        sendMessage(message);
    }

    public PlayerModule getPlayerModule() {
        return playerModule;
    }

    public void setPlayerModule(PlayerModule playerModule) {
        this.playerModule = playerModule;
    }

    public boolean isBlack() {
        return isBlack;
    }

    public void setBlack(boolean black) {
        isBlack = black;
    }
}
